﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GDF_kaart_inlezen;

namespace GDF_kaart_inlezen.strategy_classes
{
    class LayerHeader : ReadingStrategy
    {
        public LayerHeader()
        {
            recordCode = "17";
        }

        public override void Process(string record)
        {
            counter = 0;
            String fieldValue;

            if (record.Substring(0, 2) == recordCode) record = record.Substring(2);
            fieldValue = GetFieldValue("LAY_ID", ref record);
            //Implement processing
            fieldValue = GetFieldValue("XY_RES", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("XY_ACC", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("Z_ACC", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("REL_ACC", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("SURV_DATE", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("MAX_AGE", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("FEAT_COMP", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("ATT_COMP", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("ATT_COR", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("NUM_THEM", ref record);
            int num_them = Int32.Parse(fieldValue);
            for (int i = 0; i < num_them; i++)
            {
                fieldValue = GetFieldValue("THEM_COD", ref record);
                //Implement processing
            }
        }
    }
}
